﻿using System.Configuration;
using Inscriptionem.Configuration.Elements;
using Inscriptionem.Configuration.Elements.Members;

namespace Inscriptionem.Configuration
{
    public class Configuration : ConfigurationSection
    {
        public static Configuration Instance
        {
            get { return (Configuration)ConfigurationManager.GetSection("Inscriptionem"); }
        }

        [ConfigurationProperty("General")]
        public GeneralElement General
        {
            get { return (GeneralElement)this["General"]; }
            set { this["General"] = value; }
        }

        [ConfigurationProperty("Members")]
        public MembersElement Members
        {
            get { return (MembersElement)this["Members"]; }
            set { this["Members"] = value; }
        }

        [ConfigurationProperty("Comments")]
        public CommentsElement Comments
        {
            get { return (CommentsElement)this["Comments"]; }
            set { this["Comments"] = value; }
        }

        [ConfigurationProperty("Mail")]
        public MailElement Mail
        {
            get { return (MailElement)this["Mail"]; }
            set { this["Mail"] = value; } 
        }

        [ConfigurationProperty("Blog")]
        public BlogElement Blog
        {
            get { return (BlogElement)this["Blog"]; }
            set { this["Blog"] = value; }
        }

        public override bool IsReadOnly()
        {
            return false;
        }
    }
}